mps_wpt_q_add(const queue *whichQueue, const waypoint *wpt)
{
waypoint *written_wpt = waypt_dupe(wpt);
- written_wpt->Q.next = written_wpt->Q.prev = NULL;
ENQUEUE_TAIL(whichQueue, &written_wpt->Q);
}
/* Not the same lat lon, so rename and add */
newName = mkshort(written_wpt_mkshort_handle, wpt->shortname);
wptfound = waypt_dupe(wpt);
- wptfound->Q.next = wptfound->Q.prev = NULL;
xfree(wptfound->shortname);
wptfound->shortname = newName;
mps_waypoint_w(mps_file_out, mps_ver_out, wptfound, (1==0));
if (tempWpt != NULL) {
thisWaypoint = waypt_dupe(tempWpt);
- thisWaypoint->Q.next = thisWaypoint->Q.prev = NULL;
}
else {
tempWpt = mps_find_wpt_q_by_name(&read_route_wpt_head, wptname);
if (tempWpt != NULL) {
thisWaypoint = waypt_dupe(tempWpt);
- thisWaypoint->Q.next = thisWaypoint->Q.prev = NULL;
}
else {
/* should never reach here, but we do need a fallback position */
if (tempWpt != NULL) {
thisWaypoint = waypt_dupe(tempWpt);
- thisWaypoint->Q.next = thisWaypoint->Q.prev = NULL;
}
else {
thisWaypoint = waypt_new();
tmp->url = xstrdup(wpt->url);
if (wpt->url_link_text)
tmp->url_link_text = xstrdup(wpt->url_link_text);
+ /*
+ * It's important that this duplicated waypoint not appear
+ * on the master Q.
+ */
+ tmp->Q.next = tmp->Q.prev = NULL;
+ tmp->gpx_extras = NULL;
return tmp;
}